@extends('layout.master')
@section('title', '个人任务列表')
@section('content')
    <body>
    <div id="w1" class="easyui-window" data-options="iconCls:'icon-save',minimizable:false,closed:true">
        <form id="form2">
            <table style="width: 100%;" id="table">
                <tr>
                    <td style="width: 15%;text-align: center">客户全名：</td>
                    <td style="width: 85%;"><input class="easyui-textbox khqm"  name="khqm"  style="width:100%;height:32px" readonly></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">客户简称：</td>
                    <td style="width: 85%;"><input class="easyui-textbox khjc"  name="khjc"  style="width:100%;height:32px" readonly></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">客户进展：</td>
                    <td style="width:85%">
                        <select class="easyui-combobox" name="khjz" style="width:100%;">
                            <option value="">请选择</option>
                            <option value="新入库">新入库</option>
                            <option value="签单成功">签单成功</option>
                            <option value="深度回访">深度回访</option>
                            <option value="项目分类">项目分类</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">跟进记录：</td>
                    <td style="width: 85%;">
                        <textarea  class="fsyj comments" rows="10" cols="10" name="gjnr"></textarea>

                    </td>
                </tr>
                <tr><td colspan="2" style="text-align: center"><a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="$api.saveshop()">确定</a></td></tr>
            </table>
        </form>
    </div>
    <div id="w2" class="easyui-window" data-options="iconCls:'icon-save',minimizable:false,closed:true">
        <form id="form3">
            <table style="width: 100%;" id="table">
                <tr>
                    <td style="width: 15%;text-align: center">客户全名：</td>
                    <td style="width: 85%;"><input class="easyui-textbox khqm"  name="khqm"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">客户简称：</td>
                    <td style="width: 85%;"><input class="easyui-textbox khjc"  name="khjc"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">联系人：</td>
                    <td style="width: 85%;"><input class="easyui-textbox lxr"  name="lxr"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">性别：</td>
                    <td style="width:85%">
                        <select class="easyui-combobox" name="xb" style="width:100%;">
                            <option value="">请选择</option>
                            <option value="男">男</option>
                            <option value="女">女</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">生日：</td>
                    <td style="width: 85%;"><input class="easyui-textbox shr"  name="shr"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">成立日期：</td>
                    <td style="width: 85%;">
                        <input id="dd" type="text" class="easyui-datebox"  name="clrq" style="width:100%;height:32px">
                    </td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">职位：</td>
                    <td style="width: 85%;"><input class="easyui-textbox zw"  name="zw"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">微信：</td>
                    <td style="width: 85%;"><input class="easyui-textbox wx"  name="wx"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">QQ：</td>
                    <td style="width: 85%;"><input class="easyui-textbox qq"  name="qq"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">手机：</td>
                    <td style="width: 85%;"><input class="easyui-textbox sj"  name="sj"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">座机：</td>
                    <td style="width: 85%;"><input class="easyui-textbox zj"  name="zj"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">邮箱：</td>
                    <td style="width: 85%;"><input class="easyui-textbox yx"  name="yx"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">工作单位：</td>
                    <td style="width: 85%;"><input class="easyui-textbox gzdw"  name="gzdw"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">网址：</td>
                    <td style="width: 85%;"><input class="easyui-textbox wz"  name="wz"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">地址：</td>
                    <td style="width: 85%;"><input class="easyui-textbox dz"  name="dz"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">备注：</td>
                    <td style="width: 85%;"><input class="easyui-textbox bz"  name="bz"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">国家：</td>
                    <td style="width: 85%;"><input class="easyui-textbox gj"  name="gj"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">省：</td>
                    <td style="width: 85%;"><input class="easyui-textbox sheng"  name="sheng"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">市：</td>
                    <td style="width: 85%;"><input class="easyui-textbox shi"  name="shi"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">城市：</td>
                    <td style="width: 85%;"><input class="easyui-textbox chs"  name="chs"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">区县：</td>
                    <td style="width: 85%;"><input class="easyui-textbox qx"  name="qx"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">行业：</td>
                    <td style="width: 85%;"><input class="easyui-textbox hy"  name="hy"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">传真：</td>
                    <td style="width: 85%;"><input class="easyui-textbox chz"  name="chz"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">来源：</td>
                    <td style="width: 85%;"><input class="easyui-textbox ly"  name="ly"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">报考项目：</td>
                    <td style="width: 85%;"><input class="easyui-textbox bkxm"  name="bkxm"  style="width:100%;height:32px"></td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">添加qq好友：</td>
                    <td style="width:85%">
                        <select class="easyui-combobox" name="sfjqqhy" style="width:100%;">
                            <option value="">请选择</option>
                            <option value="是">是</option>
                            <option value="否">否</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">解决客户疑虑：</td>
                    <td style="width:85%">
                        <select class="easyui-combobox" name="sfjjkhyl" style="width:100%;">
                            <option value="">请选择</option>
                            <option value="是">是</option>
                            <option value="否">否</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">客户进展：</td>
                    <td style="width:85%">
                        <select class="easyui-combobox" name="khjz" style="width:100%;">
                            <option value="">请选择</option>
                            <option value="新入库">新入库</option>
                            <option value="签单成功">签单成功</option>
                            <option value="深度回访">深度回访</option>
                            <option value="项目分类">项目分类</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">客户类型：</td>
                    <td style="width:85%">
                        <select class="easyui-combobox" name="khlx" style="width:100%;">
                            <option value="">请选择</option>
                            <option value="个人客户">个人客户</option>
                            <option value="公司客户">公司客户</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="width: 15%;text-align: center">客户星级：</td>
                    <td style="width:85%">
                        <select class="easyui-combobox" name="khxj" style="width:100%;">
                            <option value="">请选择</option>
                            <option value="1星">1星</option>
                            <option value="2星">2星</option>
                            <option value="3星">3星</option>
                            <option value="4星">4星</option>
                            <option value="5星">5星</option>
                        </select>
                    </td>
                </tr>
                <tr><td colspan="2" style="text-align: center"><a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="$api.addkh()">确定</a></td></tr>
            </table>
        </form>
    </div>
    <div class="easyui-layout" data-options="fit:true">
        <div data-options="iconCls:'icon-zoom',collapsible:true,region:'north'" style="height: 123px" title="搜索条件">
            <form action="" id="form">
                <table style="width:100%">
                    <tr>
                        <td style="width:6%;" class="center">客户全名：</td>
                        <td style="width:19%"><input class="easyui-textbox" name="khqm" style="width:100%;height:32px"
                                                     prompt="请输入客户全名"></td>
                        <td style="width:6%;" class="center">客户简称：</td>
                        <td style="width:19%"><input class="easyui-textbox" name="khjc" style="width:100%;height:32px"
                                                     prompt="请输入客户简称"></td>
                        <td style="width:6%" class="center">人员性别：</td>
                        <td style="width:19%">
                            <select class="easyui-combobox" name="xb" style="width:100%;">
                                <option value="">请选择</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </td>
                        <td style="width:6%;" class="center">工作单位：</td>
                        <td style="width:19%"><input class="easyui-textbox" name="gzdw" style="width:100%;height:32px"
                                                     prompt="请输入工作单位"></td>
                    </tr>
                    <tr>
                        <td style="width:6%;" class="center">手机号码：</td>
                        <td style="width:19%"><input class="easyui-textbox" name="sj" style="width:100%;height:32px"
                                                     prompt="请输入手机号码"></td>
                        <td style="width:6%" class="center">联系人：</td>
                        <td style="width:19%"><input class="easyui-textbox" name="lxr" style="width:100%;height:32px"

                                                     prompt="请输入联系人人"></td>
                        <td style="width:6%" class="center">跟进人：</td>
                        <td style="width:19%"><input class="easyui-textbox" name="zhgjr" style="width:100%;height:32px"

                                                     prompt="请输入最后跟进人"></td>
                        <td style="width:6%" class="center">是否有效：</td>
                        <td style="width:19%">
                            <select class="easyui-combobox" name="sfyx" style="width:100%;">
                                <option value="">请选择</option>
                                <option value="是">是</option>
                                <option value="否">否</option>
                            </select>
                        </td>
                    </tr>
                </table>
                <div class="toolbar" >
                    <a href="#" class="easyui-linkbutton" onclick="$api.clearFrom()" iconCls="icon-empty">清空</a>
                    <a href="#" class="easyui-linkbutton" onclick="$api.doSearch();" iconCls="icon-zoom">查询</a>
                    <a href="#" class="easyui-linkbutton" onclick="$api.addshop(1)"  iconCls="icon-user_add">添加客户</a>
                    <a href="#" class="easyui-linkbutton" onclick="$api.addshop(2)"  iconCls="icon-user_comment_2">客户跟踪</a>
                    <a href="#" class="easyui-linkbutton" onclick="$api.fqkh()"  iconCls="icon-user_delete">放弃客户</a>
{{--                    <a href="#" class="easyui-linkbutton" onclick="$api.delshop()"  iconCls="icon-undo">删除|恢复</a>--}}
                    {{--                <a href="#" class="easyui-linkbutton" onclick="$api.addTab('人员详情','view_gooddetail',3)" iconCls="icon-edit">人员详情</a>--}}
                    {{--                http://localhost/crm/public/exportExcel--}}
{{--                    <a href="#" class="easyui-linkbutton" onclick="aaa()"  iconCls="icon-man">数据导出</a>--}}
{{--                    <a href="#" class="easyui-linkbutton" onclick="$api.khlq()"  iconCls="icon-man">客户领取</a>--}}
                </div>
            </form>
        </div>
        <!--上面是模糊搜索区域-->
        <div data-options="iconCls:'icon-folder_page',collapsible:true,region:'center'" title="搜索结果" style="height: 500px;">
            <div class="easyui-layout" data-options="fit:true">
                <table style="width:100%;" id="dg">
                    <thead frozen="true">
                    <tr>
                        <th data-options="field:'ck',checkbox:true"></th>
                        <th data-options="field:'khqm',width:160,align: 'center', title: '客户全名'"></th>
                        <th data-options="field:'khjc',width:80,align: 'center', title: '客户简称'"></th>
                    </tr>
                    </thead>
                    <thead>
                    <tr>
                        <th data-options="field:'lxr',width:80,align: 'center', title: '联系人'"></th>
                        <th data-options="field:'sj',width:120,align: 'center', title: '手机'"></th>
                        <th data-options="field:'zj',width:120,align: 'center', title: '座机'"></th>
                        <th data-options="field:'gzdw',width:160,align: 'center', title: '工作单位'"></th>
                        <th data-options="field:'cjsj',width:140,align: 'center', title: '创建时间',sortable:true"></th>
                        {{--                        <th data-options="field:'cjkhsj',width:120,align: 'center', title: '创建客户时间'"></th>--}}
                        <th data-options="field:'zhlxsj',width:140,align: 'center', title: '最后联系时间'"></th>
                        <th data-options="field:'zhgjr',width:150,align: 'center', title: '最后跟进人'"></th>
                        <th data-options="field:'xb',width:100,align: 'center', title: '性别'"></th>
                        <th data-options="field:'shr',width:100,align: 'center', title: '生日'"></th>
                        <th data-options="field:'clrq',width:120,align: 'center', title: '成立日期'"></th>
                        <th data-options="field:'khlx',width:120,align: 'center', title: '客户类型'"></th>
                        <th data-options="field:'khjz',width:120,align: 'center', title: '客户进展'"></th>
                        <th data-options="field:'khxj',width:120,align: 'center', title: '客户星级'"></th>
                        <th data-options="field:'sfyx',width:120,align: 'center', title: '是否有效'"></th>
                        <th data-options="field:'sflq',width:120,align: 'center', title: '是否领取'"></th>
                        <th data-options="field:'zw',width:100,align: 'center', title: '职位'"></th>
                        <th data-options="field:'wx',width:100,align: 'center', title: '微信' "></th>
                        <th data-options="field:'qq',width:120,align: 'center', title: 'QQ'"></th>

                        <th data-options="field:'yx',width:120,align: 'center', title: '邮箱'"></th>
                        <th data-options="field:'wz',width:120,align: 'center', title: '网址'"></th>
                        <th data-options="field:'dz',width:120,align: 'center', title: '地址'"></th>
                        <th data-options="field:'bz',width:120,align: 'center', title: '备注'"></th>
                        <th data-options="field:'gj',width:120,align: 'center', title: '国家'"></th>
                        <th data-options="field:'sheng',width:120,align: 'center', title: '省'"></th>
                        <th data-options="field:'shi',width:120,align: 'center', title: '市'"></th>
                        <th data-options="field:'chs',width:120,align: 'center', title: '城市'"></th>
                        <th data-options="field:'qx',width:120,align: 'center', title: '区县'"></th>
                        <th data-options="field:'hy',width:120,align: 'center', title: '行业'"></th>
                        <th data-options="field:'chz',width:120,align: 'center', title: '传真'"></th>
                        <th data-options="field:'ly',width:120,align: 'center', title: '来源'"></th>
                        <th data-options="field:'wxh',width:120,align: 'center', title: '微信号'"></th>
                        <th data-options="field:'bkxm',width:120,align: 'center', title: '报考项目'"></th>
                        <th data-options="field:'sfjqqhy',width:120,align: 'center', title: '是否加qq好友'"></th>
                        <th data-options="field:'sfjjkhyl',width:120,align: 'center', title: '是否解决客户疑虑'"></th>

                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <!--积分来源-->
        <div data-options="iconCls:'icon-save',collapsible:true,region:'south'" style="height: 200px;">
            <div class="easyui-layout" data-options="fit:true">
                <div data-options="collapsible:true,region:'center'" style="width: 100%">
                    <table  id="dg2">
                        <thead>
                        <tr>
                            {{--                        <th data-options="field:'ck',checkbox:true"></th>--}}
                            <th data-options="field:'gjr',width:160,align: 'center', title: '跟进人'"></th>
                            <th data-options="field:'khjz',width:160,align: 'center', title: '客户进展'"></th>
                            <th data-options="field:'create_time',width:150,align: 'center', title: '跟进时间'"></th>
                            <th data-options="field:'gjnr',width:600,align: 'center', title: '跟进内容'"></th>
                        </tr>
                        </thead>
                    </table>
                </div>

            </div>
            <!--收藏列表-->
        </div>
        <input type="hidden" value="{{$mgid}}" name="mgid" class="mgid">
    </div>

    <script>
        function aaa(){
            let params = $("#form").serializeObject();
            window.location.href = `http://wx.newamstar.com:8078/crm/public/exportExcel?khqm=${params.khqm}&khjc=${params.khjc}&zhgjr=${params.zhgjr}&sfyx=${params.sfyx}`
        }
        let mgid = $(".mgid").val();
        $api.myDataGird(
            {url: $api.url +`goodslist?mgid=${mgid}`,obj: '#dg',tt:2,singleSelect: false,plainBtn:true,onClickRow:function (index,row) {
                    $("#dg2").datagrid("load", {"gid": row.id});
                }},
            $api.myDataGird({url: $api.url +'khgzlist',tt:1, obj: '#dg2',singleSelect: true,plainBtn:true})
        );
    </script>
    <style>
        .comments {
            width:100%;/*自动适应父布局宽度*/
            overflow:auto;
            word-break:break-all;
            /*在ie中解决断行问题(防止自动变为在一行显示，主要解决ie兼容问题，ie8中当设宽度为100%时，文本域类容超过一行时，
            当我们双击文本内容就会自动变为一行显示，所以只能用ie的专有断行属性“word-break或word-wrap”控制其断行)*/
        }
    </style>
    </body>

@endsection

